package com.lzx.makeFriend.feign;

import com.lzx.common.entity.Inform;
import com.lzx.common.utils.R;
import com.lzx.makeFriend.entity.vo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
@FeignClient("five-cube-user")
public interface UserClient {
    //根据id获取用户信息(提供给其他服务)
    @GetMapping("/user/user/web/toOtherServe/{id}")
    User getUserinfoByIdToOtherServe(@PathVariable Long id);

    //用户关注其他人，关注数+1；取消关注其他人，关注数-1
    @PutMapping("/user/user/web/attentionAndCancelAttention/{userId}/{isAttention}/{attentionUserId}")
    R attentionAndCancelAttention(@PathVariable Long userId, @PathVariable Integer isAttention, @PathVariable Long attentionUserId);

    //保存通知
    @PostMapping("/user/inform/web/saveInform")
    String saveInform(@RequestBody Inform inform);

    //获取回答数前十的用户(不包括当前登录用户)
    @GetMapping("/user/user/web/getUserByReplyCount/{userId}")
    List<User> getUserByReplyCount(@PathVariable int userId);
}
